<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>分班</title>
    <link rel="stylesheet" type="text/css"
          href="../bootstrap/bootstrap.4.1.0.css">
    <script src="../bootstrap/jquery.3.2.1.min.js"></script>
    <script src="../bootstrap/popper.12.5.min.js"></script>
    <script src="../bootstrap/bootstrap.4.1.0.min.js"></script>
    <script src="../vue/Vue.js"></script>
    <script src="../vue/axios.js"></script>

</head>
<body>
<div class="container" id="app">
    <form role="form">
        <div class="form-group">
            <label for="name">-------选择--------</label>
            <select class="form-control" id="select_id">
                <option value="">选择你的学科</option>
                <option value="文科">文科</option>
                <option value="理科">理科</option>
            </select>
        </div>
    </form>

    <button type="button" class="btn btn-info active" @click="clicks()">确认</button>
</div>
</body>
<script>
    new Vue({
        el:"#app",
        methods:{
            clicks:function () {

                var message = window.location.href.split("=")[1];
                var beginTime = message.split(",")[0];
                alert(beginTime)
                var endTime = message.split(",")[1];
                alert(endTime)

                //获取下拉框的值
                var sel = document.getElementById("select_id");
                var value = sel.options[sel.selectedIndex].value;
                axios.post("divide/id/"+value+"/"+beginTime+"/"+endTime).then(res=>{
                        alert(res.data.message)
                });
            }
        }
    });
</script>
</html>